#ifndef PIXELPROCESSOR
#define PIXELPROCESSOR

#include <iostream>
#include <iomanip>
#include "../label/label.h"


class PixelProcessor
{

  enum LabelMode {
    SENDING_ADDRESS,
    RECIEVING_ADDRESS
  };

  enum ProcessorClockState {
    SET_DATA_LINE,
    READ_DATA_LINE,
    FINAL_LINE_SET
  };
  
  Label * PixelLabel;
  bool m_pixelValue;
  bool m_currentClockedAddressBit;
  bool m_removeNeighbor;
  bool bClockedDataBit;
  bool bDataLine;
  LabelMode m_currentAddressingMode;
  unsigned int m_xLocation, m_yLocation;
  unsigned int m_pixelAddress;
  unsigned int m_pixelLabel;
  unsigned int m_currentClockedBit;

  bool VerifyAgainstAddress(bool AddressBit);
  void SetBitInPixelLabel(bool LabelBit);

public:

  /* Constructor/Destructor */
  PixelProcessor(void);
  ~PixelProcessor(void);

  void ClockProcessor(void);
  void ResetProcessor(void);

  void SetPixelPosition(int x, int y);
  void SetPixelValue(bool pixel);
  void SetPixelAddress(unsigned int address); 
  void SetDataLine(bool dataBit);

  bool GetPixelValue(void);
  bool GetClockedAddressBit(void);
  bool GetClockedDataBit(void);

  void ClockAddressBit(void);
  void ClockNeighborAddressBit(void);

  LabelMode GetLabelMode(void);

};

#endif
